﻿namespace JxcLite.Pages.Finance;

public partial class AccountHead
{
    private KUpload upload;

    private async Task OnFilesChangedAsync(List<FileDataInfo> files)
    {
        if (Model.Data.IsNew)
        {
            Model.Files[nameof(AccountInfo.Files)] = files;
        }
        else
        {
            Model.Files[nameof(AccountInfo.Files)] = files;
            await Model.SaveAsync(d => upload.SetValueAsync(d.Files), false);
        }
    }
}